package com.finals.function.util;

import android.content.Context;
import android.view.WindowManager;
import android.widget.Toast;

public class Util {

	public static final String TAG = "Finals";

	public static void Toast(Context context, String text) {
		Toast toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
		toast.show();
	}

	public static int getStatusBarHeight(Context context) {
		int resourceId = 0;
		resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
		int height = 0;
		if (resourceId != 0) {
			height = context.getResources().getDimensionPixelSize(resourceId);
		}
		return height;
	}

	public static int getWindowType(int type) {
		int result = WindowManager.LayoutParams.TYPE_TOAST;
		switch (type) {
		case 0:
			result = WindowManager.LayoutParams.TYPE_TOAST;
			break;
		case 1:
			result = WindowManager.LayoutParams.TYPE_SYSTEM_ERROR;
			break;
		default:
			break;
		}
		return result;
	}

}
